include config.make

#################
## MAKE TARGET ##
#################

#-------#
# Build #
#-------#

#{#

all: talos
	@$(ECHO) $(INFORM2)"Installation Done."$(NOCOLOR)

talos: luabind
	$(CD) ./src/$@-$(talos_install_VERSION) && $(MAKE)
	@$(ECHO) $(INFORM)"TALOS Compiled"$(NOCOLOR)

luabind: lua
	$(CD) ./src/$@-$(luabindd_install_VERSION) && $(MAKE)
	@$(ECHO) $(INFORM)"LUABIND Compiled"$(NOCOLOR)

lua:
	$(CD) ./src/$@-$(lua_install_VERSION) && $(MAKE)
	@$(ECHO) $(INFORM)"LUA Compiled"$(NOCOLOR)

#}#

#-------#
# Clean #
#-------#

#{#

mrproper:
	$(CD) ./src/talos-$(talos_install_VERSION) && $(MAKE) $@
	$(CD) ./src/luabind-$(luabindd_install_VERSION) && $(MAKE) $@
	$(CD) ./src/lua-$(lua_install_VERSION) && $(MAKE) $@
	@$(ECHO) $(INFORM2)"Project is like a virgin."$(NOCOLOR)

clean:
	$(CD) ./src/talos-$(talos_install_VERSION) && $(MAKE) $@
	$(CD) ./src/luabind-$(luabindd_install_VERSION) && $(MAKE) $@
	$(CD) ./src/lua-$(lua_install_VERSION) && $(MAKE) $@
	@$(ECHO) $(INFORM)"Project Clean."$(NOCOLOR)

#}#

#---------#
# Install #
#---------#

#{#

install: mkdir_install lua_install luabindd_install talos_install
	$(CP) ./include $(INSTALL_TOP)
	$(INSTALL_DATA) ./setup.bash $(INSTALL_TOP)
	$(INSTALL_EXEC) ./bin/* $(INSTALL_BIN)
	$(LDCONFIG) $(INSTALL_LIB)
	$(CHMOD) +x $(INSTALL_TOP)
	$(CHMOD) +x $(INSTALL_INC)
	$(CHMOD) +x $(INSTALL_LIB)
	$(CHMOD) +x $(INSTALL_BIN)
	@$(ECHO) $(INFORM2)"Installation done."$(NOCOLOR)

mkdir_install:
	$(MKDIR) $(INSTALL_BIN)
	$(MKDIR) $(INSTALL_INC)
	$(MKDIR) $(INSTALL_LIB)
	$(MKDIR) $(INSTALL_DOC)

%_install: ./lib/lib%.so
	$(INSTALL_DATA) $< $(INSTALL_TOP)/$<.$($@_VERSION)
	$(CD) $(INSTALL_LIB) && $(LN) $(notdir $<.$($@_VERSION)) $(notdir $<)

uninstall:
	$(RM) $(INSTALL_TOP)

#}#

#---------------#
# Documentation #
#---------------#

#{#

doc:

install_doc:

#}#

